package com.spring.processor.factory;

import com.spring.config.AppConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class MainTest {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
//		AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
		ctx.register(AppConfig.class);
		ctx.register(A.class);
		ctx.addBeanFactoryPostProcessor(new MyBeanDefinitionRegistryPostProcessor());
		ctx.refresh();

		A a = (A) ctx.getBean("a");
		A a1 = (A) ctx.getBean("a");

		System.out.println(a == a1);
	}

}
